# -*- coding:utf-8 -*-
"""
Author：Administrator
Date:2021年10月13日
"""
import pandas as pd

path = '../数据文件/课件026/分组聚合.xlsx'
data = pd.read_excel(path)

# for (i,j),group in data.groupby(['城市', '区']):
# 	print(group)
data2 = data.groupby(['城市', '区'])[['人数', '金额']].sum()

# print(data)
print(data2)
# data2.to_excel('../数据文件/课件026/结果分组聚合01.xlsx')